home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Debug / DebugMessage.cp < prev    next >
Text File  |  1997-06-28  |  1KB  |  69 lines

  1. // DebugMessage.cp
  2.  
  3. #ifndef DebugMessage_h
  4. #include "DebugMessage.h"
  5. #endif
  6. #ifndef Numeral_h
  7. #include "Numeral.h"
  8. #endif
  9. #ifndef ConstData_h
  10. #include "ConstData.h"
  11. #endif
  12.  
  13. uint8 DebugMessage::message[ maxuint8 + 1 ];
  14.  
  15. DebugMessage::DebugMessage()
  16.   {
  17.     message[0] = 0;
  18.   }
  19.  
  20. DebugMessage::DebugMessage( ConstStr255Param string )
  21.   {
  22.     message[0] = 0;
  23.     *this += string;
  24.   }
  25.  
  26. void DebugMessage::operator+=( ConstStr255Param string )
  27.   {
  28.     for ( uint32 i = 1; i <= string[0] && message[0] < maxuint8; i++ )
  29.         message[ ++message[0] ] = string[ i ];
  30.   }
  31.  
  32. void DebugMessage::operator+=( ConstData string )
  33.   {
  34.     for ( uint32 i = 0; i < string.Length() && message[0] < maxuint8; i++ )
  35.         message[ ++message[0] ] = string[ i ];
  36.   }
  37.  
  38. void DebugMessage::operator+=( uint64 n )
  39.   {
  40.     *this += Numeral( n );
  41.   }
  42.  
  43. void DebugMessage::operator+=( int64 n )
  44.   {
  45.     *this += Numeral( n );
  46.   }
  47.  
  48. void DebugMessage::operator+=( uint32 n )
  49.   {
  50.     *this += Numeral( n );
  51.   }
  52.  
  53. void DebugMessage::operator+=( int32 n )
  54.   {
  55.     *this += Numeral( n );
  56.   }
  57.  
  58. void DebugMessage::operator+=( void *p )
  59.   {
  60.     Numeral n( uint32(p), 16 );
  61.     n.PadTo( 8 );
  62.     *this += n;
  63.   }
  64.  
  65. void DebugMessage::AddGo()
  66.   {
  67.     *this += "\p;g";
  68.   }
  69.